import { useNavigate, useParams } from 'react-router-dom';
import React, { useState } from 'react';
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from '@ant-design/icons';
import { Breadcrumb, Layout, Menu, theme } from 'antd';
import { Outlet } from 'react-router-dom';
const { Header, Content, Footer, Sider } = Layout;


function getItem(label, key, icon, children) {
  return {
    key,
    icon,
    children,
    label,
  };
}
const items = [
  getItem('用户信息管理', '1', <PieChartOutlined />),
  // getItem('卡片抽取', '2', <DesktopOutlined />),
  // getItem('个人信息', 'sub1', <UserOutlined />, [
  //   getItem('积分领取', '3'),
  //   getItem('信息', '4'),
  //   getItem('卡片', '5'),
  // ]),
  // getItem('对战界面', '6', <TeamOutlined />),
  // getItem('卡片喂养', '9', <FileOutlined />),
];

// const onFinish = (values, navigate) => {
//     console.log('Success:', values);
//     navigate('/index1');
//   };

const Adminindex1 = () => {
  const { userId } = useParams();

  const [collapsed, setCollapsed] = useState(false);
  const {
    token: { colorBgContainer, borderRadiusLG },
  } = theme.useToken();

  const navigate = useNavigate();
  const handleMenuClick = (key) => {
    console.log(key)
    if (key === "1") {
      navigate('amdin')
    }
    // else if (key === "2") {
    //   navigate('chouqu')
    // } else if (key === '3') {
    //   navigate('LinQu')
    // } else if (key === '4') {
    //   navigate('XinXi')
    // } else if (key === '5') {
    //   navigate('card')
    // } else if (key === '6') {
    //   navigate('XiaoGuai')
    // } else if (key === '9') {
    //   navigate('WeiYang')
    // }
  }

  return (
    <Layout
      style={{
        minHeight: '100vh',
      }}
    >
      <Sider collapsible collapsed={collapsed} onCollapse={(value) => setCollapsed(value)}>
        <div className="demo-logo-vertical" />
        <Menu theme="dark" defaultSelectedKeys={['1']} mode="inline" items={items} onClick={(e) => handleMenuClick(e.key)} />
      </Sider>
      <Layout>
        <Header
          style={{
            padding: 0,
            background: colorBgContainer,
          }}
        />
        <Content
          style={{
            margin: '0 16px',
          }}
        >
          <Breadcrumb
            style={{
              margin: '16px 0',
            }}
          >
            <Breadcrumb.Item>管理员</Breadcrumb.Item>
            {/* <Breadcrumb.Item>玩家1</Breadcrumb.Item> */}
          </Breadcrumb>
          <div
            style={{
              padding: 24,
              minHeight: 360,
              background: colorBgContainer,
              borderRadius: borderRadiusLG,
            }}
          >
            <Outlet />
          </div>
        </Content>
        <Footer
          style={{
            textAlign: 'center',
          }}
        >
          Ant Design ©{new Date().getFullYear()} Created by Ant UED
        </Footer>
      </Layout>
    </Layout>
  );
};
export default Adminindex1;